#include <gtest/gtest.h>
#include <mockcpp/mockcpp.hpp>

template <typename T>
T Sum(T a, T b) {
  return a + b;
}

template <typename T, typename U>
T Sum (T a, U b) {
  return a + b;
}

TEST(TemplateFunctionTest, Sum) {
  MOCKER((Sum<int>)).expects(once()).will(returnValue(0));
  EXPECT_EQ(0, Sum(1, 2));

  MOCKER((Sum<int, double>)).expects(once()).will(returnValue(1));
  EXPECT_EQ(1, Sum(1, 2.0));
  GlobalMockObject::verify();
}